<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>事件对象兼容处理</title>
		<style>
			#div1{
				width:500px;
				height:400px;
				border:1px solid red;
				margin:0 auto;
			}
			
		</style>
		<script>
			window.onload = function(){
				var oDiv = document.getElementById("div1");
				oDiv.onmousedown = function(ev){
//					兼容获得事件对象
					var e = window.event || ev;
//					FF
//					console.log(ev);
//					IE
//					console.log(window.event);
					console.log(e);
				}
			}
		</script>
	</head>
	<body>
		<div id="div1">
			12
		</div>
	</body>
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
</html>
